/*
 * 作者：姚俊
 * 功能：用于学科信息显示的action
 * 日期：2015-05-22
 */
package admin.action.baseInfo;

import java.util.ArrayList;
import java.util.List;

import teacher.bean.Teacher;

import admin.bean.Subject;
import admin.service.member.TeacherService;
import admin.service.subject.InnovationService;
import admin.service.subject.PlatformService;
import admin.service.subject.SubjectService;

public class SubjectInfoAction {
	
	private Subject subject;
	private int allCounts;
	private int professorCounts;
	private int pieProfessorCounts;
	private List<Integer> counts=new ArrayList<Integer>();
	private String flag;
	
	
	public Subject getSubject() {
		return subject;
	}


	public void setSubject(Subject subject) {
		this.subject = subject;
	}
	
	public List<Integer> getCounts() {
		return counts;
	}


	public void setCounts(List<Integer> counts) {
		this.counts = counts;
	}

	public int getAllCounts() {
		return allCounts;
	}


	public void setAllCounts(int allCounts) {
		this.allCounts = allCounts;
	}


	public int getProfessorCounts() {
		return professorCounts;
	}


	public void setProfessorCounts(int professorCounts) {
		this.professorCounts = professorCounts;
	}


	public int getPieProfessorCounts() {
		return pieProfessorCounts;
	}


	public void setPieProfessorCounts(int pieProfessorCounts) {
		this.pieProfessorCounts = pieProfessorCounts;
	}

	public String getFlag() {
		return flag;
	}


	public void setFlag(String flag) {
		this.flag = flag;
	}


	public String execute()
	{
		Subject sub=new Subject();
		sub.setSubId(1);
		this.setSubject(new SubjectService().getSubject(sub));
		InnovationService is=new InnovationService();
		counts.add(is.getCountInnovationsByLevel(0));
		counts.add(is.getCountInnovationsByLevel(1));
		counts.add(is.getCountInnovationsByLevel(2));
		counts.add(is.getCountInnovationsByLevel(3));
		counts.add(is.getCountInnovationsByLevel(4));
		counts.add(is.getCountInnovationsByLevel(5));
		counts.add(is.getCountInnovationsByLevel(6));
		PlatformService ps=new PlatformService();
		counts.add(ps.getCountPlatformByLevel(7));
		counts.add(ps.getCountPlatformByLevel(8));
		counts.add(ps.getCountPlatformByLevel(9));
		counts.add(ps.getCountPlatformByLevel(10));
		System.out.println("姓名为:"+subject.getName());
		this.setAllCounts(new TeacherService().getCountTeacherByAll(null));
		Teacher t1=new Teacher();
		t1.setDuty("教授");
		this.setProfessorCounts(new TeacherService().getCountTeacherByAll(t1));
		Teacher t2=new Teacher();
		t2.setDuty("副教授");
		this.setPieProfessorCounts(new TeacherService().getCountTeacherByAll(t2));
		return "succ";
	}

}
